<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateJobApplyDetailsTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('job_apply_details', function (Blueprint $table) {
//            $table->comment('岗位竞聘申报详情');
            $table->increments('id');
            $table->integer('job_apply_id')->index('job_apply_id_index');
            $table->integer('scale_id')->default(0)->comment('量表id');
            $table->float('scores', 5, 1)->comment('得分');
            $table->text('comment')->comment('备注');
            $table->timestamp('created_at')->nullable()->useCurrent();
            $table->timestamp('updated_at')->useCurrentOnUpdate()->nullable()->useCurrent();
            $table->boolean('type')->default(true)->comment('1-申报理由分 2-发展性项目分');
            $table->string('scale_index', 5)->default('')->comment('量表索引 ');
            $table->longText('modules')->nullable()->comment('对应模块id');
            $table->string('modules_id', 5)->default('')->comment('量表对应模块id');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('job_apply_details');
    }
};
